package poker;

/**
 * This class contains the GUI.
 *
 * @author Antti M. Harittu
 */
public class Window extends javax.swing.JFrame {
    public static javax.swing.JLabel notifyGUI;
    public static javax.swing.JLabel deckGUI;
    public static javax.swing.JLabel card1_P1;
    public static javax.swing.JLabel card1_P2;
    public static javax.swing.JLabel card2_P1;
    public static javax.swing.JLabel card2_P2;
    public static javax.swing.JLabel card3_P1;
    public static javax.swing.JLabel card3_P2;
    public static javax.swing.JLabel card4_P1;
    public static javax.swing.JLabel card4_P2;
    public static javax.swing.JLabel card5_P1;
    public static javax.swing.JLabel card5_P2;
    public static javax.swing.JButton play;
    public static javax.swing.JLabel capP1;
    public static javax.swing.JLabel capP2;
    public static javax.swing.JLabel winsGUI;

    public Window() {
        initComponents();
    }

    private void playActionPerformed(java.awt.event.ActionEvent evt) {
        Poker.play();
    }

    private void card1_P2MouseClicked(java.awt.event.MouseEvent evt) {
        Poker.actionCard(0);
    }

    private void card2_P2MouseClicked(java.awt.event.MouseEvent evt) {
        Poker.actionCard(1);
    }

    private void card3_P2MouseClicked(java.awt.event.MouseEvent evt) {
        Poker.actionCard(2);
    }

    private void card4_P2MouseClicked(java.awt.event.MouseEvent evt) {
        Poker.actionCard(3);
    }

    private void card5_P2MouseClicked(java.awt.event.MouseEvent evt) {
        Poker.actionCard(4);
    }

    private void initComponents() {
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        capP1 = new javax.swing.JLabel();
        card1_P1 = new javax.swing.JLabel();
        card2_P1 = new javax.swing.JLabel();
        card3_P1 = new javax.swing.JLabel();
        card4_P1 = new javax.swing.JLabel();
        card5_P1 = new javax.swing.JLabel();
        capP2 = new javax.swing.JLabel();
        card1_P2 = new javax.swing.JLabel();
        card2_P2 = new javax.swing.JLabel();
        card3_P2 = new javax.swing.JLabel();
        card4_P2 = new javax.swing.JLabel();
        card5_P2 = new javax.swing.JLabel();
        play = new javax.swing.JButton();
        winsGUI = new javax.swing.JLabel();
        deckGUI = new javax.swing.JLabel();
        notifyGUI = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Poker");

        capP1.setText(" ");

        card1_P1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        card1_P1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        card2_P1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        card2_P1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        card3_P1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        card3_P1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        card4_P1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        card4_P1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        card5_P1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        card5_P1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        capP2.setText(" ");

        card1_P2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        card1_P2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        card1_P2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                card1_P2MouseClicked(evt);
            }
        });

        card2_P2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        card2_P2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        card2_P2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                card2_P2MouseClicked(evt);
            }
        });

        card3_P2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        card3_P2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        card3_P2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                card3_P2MouseClicked(evt);
            }
        });

        card4_P2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        card4_P2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        card4_P2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                card4_P2MouseClicked(evt);
            }
        });

        card5_P2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        card5_P2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        card5_P2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                card5_P2MouseClicked(evt);
            }
        });

        play.setText("play");
        play.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                playActionPerformed(evt);
            }
        });

        winsGUI.setText("Wins:");

        deckGUI.setText("Deck:");

        notifyGUI.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                .addComponent(card1_P2, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(card2_P2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGroup(layout.createSequentialGroup()
                .addComponent(card1_P1, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(card2_P1, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                .addComponent(card3_P1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(card3_P2, javax.swing.GroupLayout.DEFAULT_SIZE, 64, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addGroup(layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(card4_P2, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(card5_P2, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(292, 292, 292))
                .addGroup(layout.createSequentialGroup()
                .addComponent(card4_P1, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(card5_P1, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addGroup(layout.createSequentialGroup()
                .addComponent(capP1)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGroup(layout.createSequentialGroup()
                .addComponent(capP2)
                .addGap(0, 0, Short.MAX_VALUE))
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(notifyGUI, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(winsGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(deckGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(play, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(64, 64, 64)))));
        layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(capP1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                .addComponent(card5_P1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(card4_P1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(card3_P1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(card1_P1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(card2_P1, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 66, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                .addGap(34, 34, 34)
                .addComponent(deckGUI)
                .addGap(18, 18, 18)
                .addComponent(winsGUI)
                .addGap(18, 18, 18)
                .addComponent(play))
                .addComponent(notifyGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, Short.MAX_VALUE)
                .addComponent(capP2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                .addComponent(card5_P2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(card4_P2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(card3_P2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(card2_P2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(card1_P2, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap()));

        pack();
        // </editor-fold>   
    }
} // end class Window